﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            newLogHelper1.MaxCount = 100;
            newLogHelper1.FontSize = 14f;
            newLogHelper1.Language = LogDispControl.LanguageEnum.English;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Task.Factory.StartNew(() =>
            {
                newLogHelper1.DispInfo("电子秤称重失败！原因没电子秤不在线", LogDispControl.MessageType.Alarm, true);

            }, TaskCreationOptions.LongRunning);

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Task.Factory.StartNew(() =>
            {
                newLogHelper1.DispInfo("电子秤称重失败！原因没电子秤不在线", LogDispControl.MessageType.Info, true);

            }, TaskCreationOptions.LongRunning);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            newLogHelper1.DispInfo("电子秤称重失败！原因没电子秤不在线", LogDispControl.MessageType.Important, true);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            newLogHelper1.DispInfo("电子秤称重失败！原因没电子秤不在线", LogDispControl.MessageType.Warning, true);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {
            newLogHelper1.Language = LogDispControl.LanguageEnum.English;
        }

        private void button6_Click(object sender, EventArgs e)
        {
            newLogHelper1.Language = LogDispControl.LanguageEnum.Chinese;
        }
    }
}
